﻿/////////////////////////////////////////////////////////////////////////////
// Global.cs
// 
// Program Tytle:  BlueJay
// Author:  Simon Nixon
// Copyright: 2011 ©
// Description: This file is for application wide methods and properties
//
// IDE: Microsoft Visual Studio 2005 Professional
// Language: C# 2.0
//
// $Id: Global.cs 4 2013-02-04 11:19:16Z simon.nixon@simnix.com $
// $URL: http://bluejay.googlecode.com/svn/trunk/Source/Global.cs $
/////////////////////////////////////////////////////////////////////////////
using System;
using System.Reflection;

namespace BlueJay
{
   /// <summary>
   /// Description of GlobalData.
   /// </summary>
   public class GlobalData
   {
      //==============================   
      // private variables
      //==============================
      private static string _VersionInfo;
      private static bool _DevMode = false;
      private static string _DevelopmentWarning = "";
      
      
      //==============================
      // public properties
      //==============================
      
      public string VersionInfo
      {
         get
         {
            return _VersionInfo;
         }
         set
         {
            _VersionInfo = value;
         }
      }
      
      public bool DevelopmentModeSwitch
      {
         get
         {
            return _DevMode;
         }
         set
         {
            _DevMode = value;
         }
      }
      
      public string DevelopmentWarning
      {
         get
         {
            return _DevelopmentWarning;
         }
         set
         {
            _DevelopmentWarning = value;
         }
      }

      //==============================
      // public methods
      //==============================
      public string GetVersion()
      {
      	if(DevelopmentModeSwitch == true)
      	{
      		VersionInfo = Assembly.GetExecutingAssembly().GetName().Version.Major.ToString()
                  	+"."+ Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString()
      		         +"."+ Assembly.GetExecutingAssembly().GetName().Version.Build.ToString()
         			+ DevelopmentWarning;
      	}
      	else
      	{
      		VersionInfo = Assembly.GetExecutingAssembly().GetName().Version.Major.ToString()
                  	+"."+ Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString();
      	}
         	
        return VersionInfo;
      }
   }
}
